package com.itany.boot.util;

/**
 * @author shixiaojun@itany
 */
public class ResponseResult {
    private String responseCode;
    private String message;
    private Object returnObject;

    public static ResponseResult success() {
        ResponseResult result = new ResponseResult();
        result.setResponseCode("200");
        result.setMessage("成功");
        return result;
    }

    public static ResponseResult success(Object returnObject) {
        ResponseResult result = new ResponseResult();
        result.setResponseCode("200");
        result.setMessage("成功");
        result.setReturnObject(returnObject);
        return result;
    }

    public static ResponseResult fail(String message) {
        ResponseResult result = new ResponseResult();
        result.setResponseCode("400");
        result.setMessage(message);
        return result;
    }

    public ResponseResult() {
    }

    public ResponseResult(String responseCode, String message, Object returnObject) {
        this.responseCode = responseCode;
        this.message = message;
        this.returnObject = returnObject;
    }

    public String getResponseCode() {
        return responseCode;
    }

    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getReturnObject() {
        return returnObject;
    }

    public void setReturnObject(Object returnObject) {
        this.returnObject = returnObject;
    }
}
